package com.etc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping(value = "requestParamapi")
public class RequestParamController {

	@RequestMapping(value = "test1")
	public String test1(String name) {
		System.out.println("test1参数：" + name);
		return "test1";
	}

	@RequestMapping(value = "test2")
	public String test2(@RequestParam(name = "name", required = false, defaultValue = "小黄") String name) {
		System.out.println("test2参数：" + name);
		return "test2";
	}

	@RequestMapping(value = "test3")
	public String test3(@RequestParam(name = "name", required = true) String name) {
		System.out.println("test3参数：" + name);
		return "test3";
	}

	@RequestMapping(value = "test4")
	public String test4(@RequestParam(name = "name", required = true, defaultValue = "小黑") String name) {
		System.out.println("test4参数：" + name);
		return "test4";
	}

}
